<?
function GetConnection()
{
	return new mysqli('wyvern.cs.newpaltz.edu', 'N02036842', 's741780', 'N02036842_db');
}
//**************************************************
function escapeAllFields($rs, $conn)
{
	$retval = array();
	foreach($rs as $key => $value)
	{
		$retval[$key] = htmlentities( $conn->real_escape_string($value));
	}
	print_r($retval);
	return $retval;
}
//**************************************************
function GetSubjects()
{
	$conn = GetConnection();
	$sql = "SELECT * FROM Final_Subjects";
	$results = $conn->query($sql);
	$conn->close();
	return $results;
}
//**************************************************
function GetURL($subId)
{
	$conn = GetConnection();
	$sql = "SELECT * FROM Final_Urls WHERE SubjectId = '$subId'";
	$results = $conn->query($sql);
	$conn->close();
	return $results;
}
//**************************************************